//
//  ViewController.m
//  Autosizecode
//
//  Created by student on 16/3/2.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
// 竖屏使用
#define W(x) (x * kScreenWidth / 320.0)
#define H(y) (y * kScreenHeight / 568.0)
// 横屏使用
#define WR(y) (y * kScreenHeight / 320.0)
#define HR(x) (x * kScreenWidth / 568.0)

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *BigLabel;
@property (weak, nonatomic) IBOutlet UILabel *Label1;
@property (weak, nonatomic) IBOutlet UILabel *Label2;
@property (weak, nonatomic) IBOutlet UILabel *Label3;
@property (weak, nonatomic) IBOutlet UILabel *Label4;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    
    if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft||toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
    {
        self.BigLabel.frame = CGRectMake(50, 50, 350, 300);
        self.Label1.frame = CGRectMake(450, 40, 140, 50);
        self.Label2.frame = CGRectMake(450, 40*3, 140, 50);
        self.Label3.frame = CGRectMake(450, 40*5, 140, 50);
        self.Label4.frame = CGRectMake(450, 40*7, 140, 50);
    }
}

@end
